
package org.dea.facade;

import java.io.File;

import de.gulden.util.javasource.Class;

public class AllFacadesMaker implements FacadeMaker {

    private final String mappingFile;

    public AllFacadesMaker( String mappingFile ) {

        this.mappingFile = mappingFile;
    }

    public Class generateFacade( File sourceDir, String fullQualifiedName ) throws Exception {

        new RMIFacadeMaker().generateFacade( sourceDir, fullQualifiedName );
        new RMIInterfaceFacadeMaker().generateFacade( sourceDir, fullQualifiedName );
        return new SwitchFacadeMaker( mappingFile ).generateFacade( sourceDir, fullQualifiedName );
    }

    public static void main( String[] args ) throws Exception {

        String mappping = args[ 0 ];
        String sourceDir = args[ 1 ];
        String facadeName = args[ 2 ];
        new AllFacadesMaker( mappping ).generateFacade( new File( sourceDir ), facadeName );
//    	new AllFacadesMaker("test/xml/onlyAlpha.xml").generateFacade(new File("test"), "somepack.innerpack.Simple");
    }

}
